<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
    String actionURL = path + "/cms/roominfo/doQuery.do";
%>
<!doctype html
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<base href="<%=basePath%>">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<title>智慧酒店服务应用平台</title>
<link href="css/css-main.css" rel="stylesheet" type="text/css" />
<link rel=stylesheet type=text/css href="css/msgbox/jquery.msgbox.css" />
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/msgbox/jquery.dragndrop.min.js"></script>
<script type="text/javascript" src="js/msgbox/msgbox.js"></script>
<script type="text/javascript" src="js/zDialog/zDialog.js"></script>
<script type="text/javascript" src="js/zDialog/zDrag.js"></script>
<script type="text/javascript" src="js/common.js"></script>
<script type="text/javascript">
/*******************************************************************************
 * 全选  fromName form名称  boxname 控件名称
 ******************************************************************************/
function selectAll(fromName, boxname) {
	var f = document.forms[fromName];
	for ( var i = 0; i < f.elements[boxname].length; i++) {
		if (f.elements[i].name == boxname) {
			f.elements[i].checked = !f.elements[i].checked;
		}

	}
}

/**
 * 复选框删除功能 可以传递自定义描述
 */
function confirmDel(doc)
{    
    var delNum = 0;
    var f = doc.form_del;
    len = f.innerIndexs.length;
   
    for(var i=0;i<len;i++)
    {
           if(f.innerIndexs[i].checked)
           {
               delNum++;
           }
    }
     if(delNum <= 0)
    {    
        alert("请至少选择一条待删除记录");    
        return false;
    }
    var desc = "你确定要删除"+ delNum +"条记录吗？\n记录删除后将无法恢复！"; 
  
    if(window.confirm(desc))
    {
       document.form_del.submit();
       return true;
    }
    else
    {
      return false;
    }
}
</script>
</head>


<body>
<div class="main-con">
	<!--//导航位置层-->
	<div class="main-bar">
		<span class="bar-position">当前位置：<a href="#">设施管理</a>
			&gt;&gt; 房间管理</span>
	</div>
    <div class="cont_right_cont">
        <div>
          <table width="100%" border="0" cellpadding="0" cellspacing="0">
            <tr>
              <td width="100" valign="middle"><input name="button5" type="submit" class="btn-Yes" id="button5" value="增加" onClick="$.toAddDiag(550,980,'新增房间信息','toAdd.do')"></td>
              <td valign="middle"><input name="button2" type="submit" class="btn-Yes" id="button2" value="删除" onClick="confirmDel(document);"></td>
              <td align="right" valign="middle">查询条件：</td>
              <td width="120" height="40" align="right" valign="middle"><select name="select2" class="data-searchtxt-select" id="queryConditon_key" style="width:100px">
                  <option value="名称" selected>名称</option>
                  <option value="类别">类别</option>
                  <option value="供应商">供应商</option>
              </select></td>
              <td width="150" align="right" valign="middle"><span style="padding:0px">
                <input name="textfield9" type="text" class="data-searchtxt-runtime" id="queryConditon_value" value="" />
                </span></td>
              <td width="100" align="right" valign="middle"><input name="button" type="button" onClick="do_search(1);" class="data-searchbtn" id="button" value="查 询"/></td>
            </tr>
          </table>
        </div>
        <div class="cont_right_cont">
	        <form name="form_del" id="form_del" target="hid"
						action="cms/roominfo/doDel.do">
		        <table width="100%" border="0" cellspacing="0" cellpadding="0" class="datalist">
		          <tr>
		            <th width="4%"><input type="checkbox" name="checkbox" id="checkbox"></th>
		            <th>房间号</th>
		            <th>房间类型</th>
		            <th>房间状态</th>
		            <th>所属楼层</th>
		            <th>设备</th>
		            <th>描述</th>
		            <th width="15%">操作</th>
		          </tr>
		          
		          <!-- 记录为空 -->
				<s:if test=" results.size == 0">
				</s:if>
				 <!-- 存在记录 -->
				 
				 <!-- 存在记录 -->
						<s:if test=" results.size > 0">
							<!--显示List记录！-->
							<s:iterator value="results" status="s">
								<tr>
									<td><input type="checkbox" name="innerIndexs"
										id="innerIndexs"
										value='<s:property value="results[#s.index].innerIndex"/>'>
									</td>
									<td><s:property value="results[#s.index].roomNum" />
									</td>
									<td><s:property
											value="results[#s.index].roomTypeInfo.roomTypeName" />
									</td>
									<td>
										<s:if test=' results[#s.index].roomStatus == 0 '>
												空闲
										</s:if>
										<s:if test=' results[#s.index].roomStatus == 1 '>
												预定
										</s:if>
										<s:if test=' results[#s.index].roomStatus == 2 '>
												使用
										</s:if>
										<s:if test=' results[#s.index].roomStatus == 3 '>
												维修
										</s:if>
									
									</td>
									<td><s:property value="results[#s.index].floor" />
									</td>
									<td>
									<!--  
									<s:property
											value="results[#s.index].roomDesc" />
										-->	
											
									</td>
									<td><s:property
											value="results[#s.index].roomDesc" />
									</td>
									<td nowrap><a href="javascript:void(0);" class="ico_edit"
										onclick="$.toModDiag(500,600,'修改房间信息','toMod.do?innerIndex=<s:property value="results[#s.index].innerIndex"/>')">修改</a>
									</td>
								</tr>
							</s:iterator>
						</s:if>
				 
		        </table>
	        </form>
       <form name="pages" method="post" >
					<!--隐藏域 Start -->
					<!-- 引入分页和排序 -->
					<div style="display:none ">
						<input id="curPage" type="hidden" name="page.curPage" value="<s:property value='page.curPage'/>"> 
						<input id="numPerPage" type="hidden" name="page.numPerPage" value="<s:property value='page.numPerPage'/>">
                        <input type="hidden" id="queryConditon_key_hidden" name="queryConditon.key" value="<s:property value='queryConditon.key'/>" > 
                        <input id="queryConditon_value_hidden" type="hidden" name="queryConditon.value" value="<s:property value='queryConditon.value'/>">
                        <iframe name="hid" id="hid" src="" height="0px"></iframe>
					</div>
					
					<!--隐藏域 End   -->
				<div <s:if test=" results.size == 0">style="display:none "</s:if>>
					<%@include file="/jsp/cms/common/page.txt"%>
				</div>
				</form>
      </div>
  </div>
</div>
</body>
</html>
